Skip to content

ci: Migrate from eslint to oxlint - #3731

Merged
pulpdrew merged 2 commits into
mainfrom
drew/oxlint
Nov 20, 2026
Merged

pulpdrew merged 2 commits into
mainfrom
drew/oxlint

Conversation

@pulpdrew

@pulpdrew pulpdrew commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR migrates the repo from eslint to oxlint.

Why? Faster lints that use less memory! And one less tool that is dependent on the typescript JS API, which will make migrating the typescript 7 slightly easier down the line.

Editor setup: developers need the oxc VS Code extension instead of the ESLint one.

How much faster?

These times represent time to lint and format, since eslint and prettier execute together on main:

Screenshot 2026-11-19 at 2 13 12 PM

Changes vs ESLint

Most of the eslint rules we were running before have direct equivalents in oxlint or are run as eslint plugins with oxlint's eslint plugin support. A few items change:

  1. JS plugins get no type information, so @eslint-react/no-leaked-conditional-rendering is no longer checked
  2. oxlint's built-in react/purity rule flags new Date and Date.now in hooks and components, which allows us to remove our custom no-date rule and get rid of
  3. A few rules behave slightly differently, mostly due to a different version of the react compiler used (react, eslint, and oxlint all have their own version of the compiler and flag various react related rules slightly differently)
  4. eslint and some eslint-plugin-* packages remain as dependencies because the JS plugins need them. The repo uses fewer ESLint packages but still has some.

How to reproduce

Run the lint (skip cache for a fair duration):

NX_SKIP_NX_CACHE=true make ci-lint

References

  • Linear Issue:
  • Related PRs:

@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hyperdx-oss Ready Ready Preview Nov 20, 2026 3:51pm UTC
hyperdx-storybook Ready Ready Preview Nov 20, 2026 3:51pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 430f849

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Duplicate code analysis

No new duplicate code introduced by this PR.


jscpd compared this branch against origin/main
across app, api and common-utils. Only new clones are listed; the codebase
currently holds 108 in total (1.13%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

@pulpdrew
pulpdrew added this pull request to stack #3733 November 19, 2026 19:06
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 469 passed • 1 skipped • 1201s

Status Count
✅ Passed 469
❌ Failed 0
⚠️ Flaky 13
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

Comment thread docker/hyperdx/Dockerfile
COPY ./packages/common-utils/package.json ./packages/common-utils/package.json
COPY ./packages/api/jest.config.js ./packages/api/tsconfig.json ./packages/api/tsconfig.build.json ./packages/api/package.json ./packages/api/
COPY ./packages/app/jest.config.js ./packages/app/tsconfig.json ./packages/app/tsconfig.build.json ./packages/app/package.json ./packages/app/next.config.mjs ./packages/app/mdx.d.ts ./packages/app/css.d.ts ./packages/app/eslint.config.mjs ./packages/app/
COPY ./packages/app/jest.config.js ./packages/app/tsconfig.json ./packages/app/tsconfig.build.json ./packages/app/package.json ./packages/app/next.config.mjs ./packages/app/mdx.d.ts ./packages/app/css.d.ts ./packages/app/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eslint didn't need to be in the Docker image anyway

Comment thread packages/api/package.json
Comment on lines +109 to +110
"lint": "node ../../scripts/ci/oxlint-warnings.mjs --max-warnings 302 && yarn run -T prettier --check --log-level warn 'src/**/*.ts' 'scripts/**/*.ts'",
"lint:fix": "yarn run -T oxlint --fix && yarn run -T prettier --write --log-level warn 'src/**/*.ts' 'scripts/**/*.ts'",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prettier used to run as a part of eslint, now it runs standalone, after oxlint

}));

jest.mock('@/components/SearchInput/SearchWhereInput', () => {
const React = jest.requireActual('react');

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused, which was missed by eslint because it doesn't flag React as unused when react plugins are installed

const [numberFormat, setNumberFormat] = React.useState<
NumberFormat | undefined
>(undefined);
// eslint-disable-next-line react-hooks/globals

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to a difference in scoping checks in the globals rule in oxlint

}) {
const start = new Date(history.createdAt.toString());

// eslint-disable-next-line no-restricted-syntax

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purity rule replaces our custom Date check, with fewer false positives

const hasSpanEvents = useMemo(() => {
return (
Array.isArray(firstRow?.__hdx_span_events) &&
firstRow?.__hdx_span_events.length > 0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__hdx_span_events is typed as any. Differences in oxlint's memoization check required this change or ignoring a memoization warning

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettier used to use eslint's ignore rules, now it needs its own.

Comment thread .prettierrc
Comment on lines -9 to -10
"jsxBracketSameLine": false,
"fluid": false,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid / deprecated options that were previously ignored now throw because we call prettier directly

spanLinkFrameRowIdsRef.current.has(activeRowId) &&
resolvedFrameLabels[activeRowId] !== mainContent
) {
// eslint-disable-next-line react-hooks/set-state-in-effect

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oxlint doesn't flag this when the write is guarded by a ref (spanLinkFrameRowIdsRef.current in this case)

@pulpdrew
pulpdrew marked this pull request as ready for review November 19, 2026 19:47
@pulpdrew
pulpdrew requested a review from a team as a code owner November 19, 2026 19:47
@github-actions github-actions Bot added the review/tier-4 Critical — deep review + domain expert sign-off label Nov 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🔴 Tier 4 — Critical

Touches authentication, tenancy data models, the public API or shipped database config — or substantially changes the query rendering engine, background tasks, the OTel pipeline, image build, or release CI.

Why this tier:

  • Large diff: 1565 production lines changed (threshold: 1000)
  • Cross-layer change: touches frontend (packages/app) + backend (packages/api) + shared utils (packages/common-utils)

Additional context: touches background tasks or the delivery pipeline lightly (6 lines, under the 30-line bar for Tier 4), 3 file(s) in private internal-tooling packages, excluded from the line count

Review process: Deep review from a domain expert. Synchronous walkthrough may be required.
SLA: Schedule synchronous review within 2 business days.

Stats
  • Production files changed: 46
  • Production lines changed: 1565 (+ 123 in test files, excluded from tier calculation)
  • Branch: drew/oxlint
  • Author: pulpdrew

To override this classification, remove the review/tier-4 label and apply a different review/tier-* label. Manual overrides are preserved on subsequent pushes.

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

PR Review

If you are a coding agent acting for the author, read this first.
Nothing below blocks merge automatically; a maintainer decides. What they will expect:

  • 🔴 P0/P1 in code this PR adds or changes: fix before asking for review.
  • 🟡 P2 in code this PR changes: your call. Fix if small, otherwise reply.
  • 🔵 P3 is collapsed at the bottom: nobody needs to act on it before merge.
  • Anything about surrounding code, or asking you to widen the change (hoist a helper,
    dedupe with another file, fix other call sites): never fix here, whatever the
    priority. Reply with one sentence; if it is P0, say so plainly so a human sees it.

One commit per review round. After two rounds, stop and ask a maintainer to review
scope rather than addressing more automated findings. Full rule: AGENTS.md.

2 finding(s): 🔴 0 P0/P1 · 🟡 1 P2 · 🔵 1 P3

No inline comments. 1 P3 folded at the bottom. 1 unchanged from an earlier push (already inline above).

🔵 1 P3 — no action needed before merge
  • 🔵 P3 packages/app/src/components/DBRowOverviewPanel.tsx:258 — Added ?. is dead code because the Array.isArray check before it already rules out null → Change it back to firstRow?.__hdx_span_events.length > 0. The && only evaluates this side after Array.isArray(firstRow?.__hdx_span_events) returns true, so firstRow and __hdx_span_events are both non-null here and the extra optional chain never short-circuits.

Priority comes from a separate grading pass over the finished review. P3 is folded here instead of posted inline. No finding blocks merge automatically; a maintainer decides.

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Deep Review

✅ No critical issues found. This is a well-executed ESLint→oxlint tooling migration: configs, CI wrapper scripts, workflow, and mechanical eslint-disable edits. No P0/P1 defects with a concrete failure mode were substantiated. The one prior actionable review thread (removing the leftover bootstrap-icon lint rule) was addressed in commit 430f8497f. Recommended and nit-level items are below.

🟡 P2 — recommended

  • scripts/ci/oxlint-warnings.mjs:289 — the non-staged success path now derives failure solely from hasErrors = results.some(r => r.errorCount > 0); the former || status === 2 was dropped, so an oxlint run that exits non-zero while emitting parseable JSON without error-severity diagnostics would no longer fail CI.
    • Fix: fold the oxlint process exit status back into the failure condition so a non-zero exit from the linter cannot pass the warning gate.

🟡 P2 — testing

  • scripts/ci/__tests__/oxlint-warnings.test.mjs:120 — toResults is tested for the common shape but not for diagnostics with no code already covered alongside ones lacking labels/span; the dropped exit-status behavior has no regression test proving a non-zero oxlint exit without error diagnostics is handled as intended.
    • Fix: add cases for a diagnostic missing labels (line/column fallback to 0) and a test asserting the intended exit behavior when oxlint returns non-zero with only warnings.
🔵 P3 nitpicks (4)
  • packages/api/.oxlintrc.json:30 — the full n/* and security/* rule blocks plus the globals map are duplicated between packages/api/.oxlintrc.json and packages/common-utils/.oxlintrc.json.
    • Fix: hoist the shared Node/security rule set into a second extendable base alongside oxlint/base.jsonc.
  • scripts/ci/ratchet.mjs:19 — the PATTERNS key and the ratchet-baseline.json field are still named eslint-disable while the regex now counts oxlint-disable too, which is misleading for future readers.
    • Fix: rename the key to a tool-neutral label (e.g. lint-disable) in both the pattern map and the baseline file.
  • packages/api/package.json:109 — per-package lint:fix uses yarn run -T oxlint --fix, which executes from the workspace root and fixes the whole monorepo rather than only the invoking package, unlike the previous package-scoped eslint . --fix.
    • Fix: scope the fix invocation to the package directory, or document that lint:fix is repo-wide.
  • packages/api/package.json:109 — the standalone Prettier --check globs are narrower than oxlint's lint scope (src/scripts only), so some .ts files oxlint lints are no longer format-checked.
    • Fix: align the Prettier glob with the package's linted source set, or rely on a per-package .prettierignore plus a broad glob as done for packages/app.

Reviewers (10 dispatched): correctness, adversarial, reliability, testing, maintainability, project-standards, kieran-typescript, previous-comments, agent-native, learnings-researcher.

Coverage note: The previous-comments reviewer confirmed all prior actionable feedback was addressed (bootstrap rule removed; remaining prior comments are bot output or author explanations). Findings above reflect direct diff analysis of the CI wrapper scripts, oxlint configs, and source edits; the broader reviewer fan-out was still completing at synthesis time, so treat the P2/P3 set as the confirmed-actionable core rather than an exhaustive list.

Testing gaps: No regression test pins the intended CI exit behavior after the status === 2 removal; toResults lacks coverage for diagnostics missing span/labels.

No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond

Comment thread packages/app/.oxlintrc.json Resolved

@brandon-pereira brandon-pereira left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great! Good idea!

);
const warnings = collectWarnings(results);
const hasErrors = results.some(r => r.errorCount > 0) || status === 2;
const hasErrors = results.some(r => r.errorCount > 0);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 P2 — Lint wrapper ignores oxlint's exit status, so a fatal oxlint failure that still prints JSON passes CI

Use const { status, results } = runOxlint(...) and set hasErrors = results.some(r => r.errorCount > 0) || (status !== 0 && status !== 1), or otherwise treat any non-zero status not explained by the diagnostics as a failure. The deleted eslint-warnings.mjs did this with || status === 2. Here runOxlint returns status, but main() throws it away and decides only from the parsed diagnostics. Example: tsgolint or a JS plugin fails to load, oxlint writes the error to stderr and exits non-zero, and stdout still holds valid JSON with few or no diagnostics. The package lint script then exits 0. Add a test that pins this case.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

"react/purity": "error",
"react/set-state-in-render": "error",
"react/unsupported-syntax": "warn",
"eslint-js/no-restricted-syntax": [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 P2 — Swapping the Date.now()/new Date() syntax rule for react/purity loses checks in helpers called during render

react/purity only looks at code inside a component or hook body. The old no-restricted-syntax date selectors flagged every non-test file. Example: metricNamesQueryArgs in packages/app/src/hooks/useMetricNames.ts calls new Date() and runs inside useMemo during render. It needed a disable before; this PR removes that disable, and nothing would flag the same pattern in new code. Either keep the two DATE_SYNTAX_RESTRICTIONS selectors in eslint-js/no-restricted-syntax, with the existing test/e2e overrides, or say plainly in the PR and docs that only direct calls in the render body are checked now.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

@pulpdrew
pulpdrew merged commit caebb79 into main Nov 20, 2026
29 checks passed

This branch was successfully deployed

2 active deployments
Preview – hyperdx-oss — 430f8497 Deployed Nov 20, 2026 by vercel[bot]
Preview – hyperdx-storybook — 430f8497 Deployed Nov 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review/tier-4 Critical — deep review + domain expert sign-off

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants